mybatis配置mapperLocations多个路径

<property name="mapperLocations">
      <array>
          <value>classpath*:/mybatis-config.xml</value>
          <value>classpath*:/com/**/sqlmap-*.xml</value>
      </array>
</property>
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
      <property name="mapperLocations">
          <array>
              <value>classpath:mybatis/mapper/*.xml</value>
              <value>classpath:mybatis/mapper/database/*.xml</value>
          </array>
      </property>
      <property name="dataSource" ref="dataSource"/>
      <property name="configLocation" value="classpath:mybatis/config/mybatis-config.xml"/>
</bean>
<property name="mapperLocations" >
     <list>
          <value>classpath*:/sqlmap/*.xml</value>
          <value>classpath*:/test/*.xml</value>
     </list>
</property>

 

posted @ 2017-03-21 09:32  岁月淡忘了谁  阅读(32513)  评论(0编辑  收藏  举报